import {
  View,
  Text,
  StyleSheet,
  Button,
  useWindowDimensions,
} from 'react-native';
import React, {useEffect, useState} from 'react';
import Children1 from '../../components/Children1';
import Children2 from '../../components/Children2';

import {TabView, SceneMap} from 'react-native-tab-view';

const renderScene = SceneMap({
  first: Children1,
  second: Children2,
});

export default function Product() {

  const layout = useWindowDimensions();

  const [index, setIndex] = React.useState(0);
  const [routes] = React.useState([
    {key: 'first', title: '视频监控'},
    {key: 'second', title: '基本信息'},
  ]);
  return (
    <>
      <TabView
        navigationState={{index, routes}}
        renderScene={renderScene}
        onIndexChange={setIndex}
        initialLayout={{width: layout.width}}
      />
    </>
  );
}
